package ru.urfc.portal.ui.client.controllers.loaders;

import ru.urfc.portal.ui.client.descriptor.GridDescriptor;
import ru.urfc.portal.ui.client.widgets.BaseFilter;

import com.extjs.gxt.ui.client.data.BaseModelData;

public class GridLoader extends LoaderWithPaging {

	private BaseFilter filter;
	
	public GridLoader(GridDescriptor descriptor) {
		super(descriptor);
	}
	
	@Override
	protected Object prepareLoadConfig(Object config) {
		if (filter != null && config instanceof BaseModelData) {
			filter.addParameters((BaseModelData)config);
		}
		return super.prepareLoadConfig(config);
	}
	
	public void setFilter(BaseFilter filter) {
		this.filter = filter;
	}
	
}